<template>
  <div class="hello">
      <h1>{{msg}}</h1>
      <button @click="addOne">add</button>
      <button @click="minusOne">minus</button>
  </div>
</template>

<script>
    export default{
        name:'hello',
        data(){
            return{
                msg:'I am banana.',
                price:10
            }
        },
        methods: {
            
            addOne(){
                this.$store.commit('increment',this.price);
            },
            minusOne(){
                this.$store.commit('decrement',this.price);
            }
        }
    }
</script>

<style>
    .hello h1{
        color: red;
    }
</style>
